package com.yeziji.dataCenter.controller.v1;

import com.yeziji.common.CommonResult;
import com.yeziji.dataCenter.business.dataSource.service.DataCenterDataSourceService;
import com.yeziji.devops.business.dataSource.dto.DevopsDataSourceOperateDTO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 数据源控制接口
 *
 * @author hwy
 * @since 2024/11/07 10:20
 **/
@RestController
@RequestMapping("/api/v1/db")
public class DataSourceController {
    @Resource
    private DataCenterDataSourceService dataCenterDataSourceService;

    @PostMapping("/create")
    public CommonResult<String> createDataSource(@RequestBody DevopsDataSourceOperateDTO operateDTO) {
        return CommonResult.success(dataCenterDataSourceService.createDataSource(operateDTO), "ok");
    }
}
